Skip to main content

Dimensionality

Previously, we introduced the concept of linear transformations. We ran through a few examples in 2D to aid our understanding. In this section, we will extend our discussion to different dimensions.

Table of Contents

Linear Transformations in 3D

In 2D, we had linear transformations that mapped vectors from 2D to 2D. Symbolically, we explored transformations of the form .

We visualized these transformations by observing how it transformed the coordinate grid in 2D:

It's important to note that in this visualization, each point on the grid is simply a condensed representation of a vector with the tip at that point. The transformation is applied to each of these vectors, and we visualize that by observing how they physically move.

2D linear transformations can be represented by a matrix, where each column represents where the basis vectors and are mapped to. The linear transformation in the above visualization can be represented by the following matrix:

In 3D, things are very similar, except we are now working with vectors in .

2D3D
matrix matrix

Below is a visualization of a 3D linear transformation. They're notably harder to visualize, but we can still observe how the transformation affects the coordinate grid:

In this transformation, the basis vectors are mapped to the vectors respectively. Hence, we can represent this transformation with the following matrix:

Recall that after a linear transformation, a vector is mapped to a new vector such that the coefficients of the basis vectors remain the same. This is the same for 3D linear transformations:

Generalizing, if we have any matrix , the matrix-vector product looks like this:

Linear Transformations Between Dimensions

The linear transformations that we've discussed so far have been between the same dimensions. This means that if you give the transformation a 2D vector, it will output a 2D vector, and likewise for 3D vectors. This does not have to be the case - we can have linear transformations that map vectors from one dimension to another. (In an even more general sense, we can have linear transformations that map vectors from any vector space to another.)

Consider a linear transformation that takes a 2D vector and outputs a 3D vector:

In a visual sense, this transformation can be thought of as taking a 2D vector and "lifting" it into 3D space. When applying transformations like this to the coordinate grid, it's less helpful to think of "moving" vectors. Instead, let's place a 2D grid and a 3D grid side by side, and observe the basis vectors on both:

Alternatively, we can place a copy of the 2D grid on the -plane of the 3D grid so that we can observe the transformation more clearly:

We can go the other way as well: a linear transformation that takes a 3D vector and outputs a 2D vector:

This transformation can be thought of as "flattening" a 3D vector into 2D space. These flattening and lifting transformations are common in computational stuff. For instance, in games and graphics, we have a virtual 3D world that we need to project onto a 2D screen. This is done by a transformation that takes 3D vectors and outputs 2D vectors. This is also why GPUs can be thought of as specialized hardware for performing matrix and vector operations.

Nonsquare Matrix Representation

If we want to represent the transformation in the previous example with a matrix, we will do what we did before: place the coordinates of each basis vector in a column. In the transformation, is mapped to and is mapped to . Thus, the matrix representation of this transformation is:

Notice that our matrix is no longer square. Instead, it has rows and columns. Thus, we call it a matrix, corresponding to a transformation from to .

Transformation Compatibility

When we have a linear transformation that maps vectors from one dimension to another, we need to ensure that the dimensions of the matrix match the dimensions of the input and output vectors.

For example, if we have a linear transformation mapping from to , the vector input must have components:

More generally, if we have a linear transformation mapping from to , the matrix representing the transformation must have rows and columns:

  • Each column represents a transformed basis vector. Since the input vector has components, the matrix must have basis vectors, so it must have columns.
  • Each row represents one component of the transformed basis vector. The output vector has components, so the matrix must have rows.

The input to this transformation must have components, and the output will have components:

Summary and Next Steps

In this section, we extended our discussion of linear transformations to different dimensions.

Here are the key points to remember:

  • Linear transformations can map vectors from one dimension to another.

  • The matrix representation of a linear transformation must have dimensions that match the input and output vectors.

    More specifically, if we have a linear transformation mapping from to , the matrix representing the transformation must have rows and columns. This matrix is known as a matrix.

In the next section, we will explore how we can combine multiple linear transformations and multiply matrices to represent these transformations.